import { requestClient } from '#/api/request';

export interface CustomerTransferBatchDTO {
  customerIds: number[];
  toStaffId: number;
  transferReason: string;
}

export interface CustomerTransferSingleDTO {
  customerId: number;
  toStaffId: number;
  transferReason: string;
  remark?: string;
}

export const customerTransferApi = {
  // 获取离职员工及其客户
  getResignedStaffCustomers(storeId?: number) {
    return requestClient.get('/hm/customer/transfer/resigned-staff-customers', {
      params: { storeId },
    });
  },

  // 获取在职员工列表
  getActiveStaffByStore(storeId: number) {
    return requestClient.get('/hm/customer/transfer/active-staff', {
      params: { storeId },
    });
  },

  // 批量迁移客户
  batchTransferCustomers(data: CustomerTransferBatchDTO) {
    return requestClient.post('/hm/customer/transfer/batch-transfer', data);
  },

  // 单个客户迁移
  singleTransferCustomer(data: CustomerTransferSingleDTO) {
    return requestClient.post('/hm/customer/transfer/single-transfer', data);
  },
};
